﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Quan_Ly_Phong_Kham_co_len_em
{
    public partial class frmkhoa_phong : Form
    {
        public frmkhoa_phong()
        {
            InitializeComponent();
        }

         public SqlConnection getconnect()
        {
            return new SqlConnection("Data Source=NGUYENTY-PC\\SQLEXPRESS;Initial Catalog=QL_PHONGKHAM;Integrated Security=True");

        }

        private void frmkhoa_phong_Load(object sender, EventArgs e)
        {
            SqlConnection ketnoi = getconnect();
            SqlDataAdapter ad = new SqlDataAdapter("HienThiKhoa", ketnoi); //ket noi den co so du lieu de goi ham da khai bao trong StoredProcedure
            DataTable dt = new DataTable();
            ad.Fill(dt);
            dt_khoa.DataSource = dt;// do du lieu vao DataGridView dt_BenhNhan
        }

        private void bt_Them_Click(object sender, EventArgs e)
        {

        }
    }
}
